package com.leetcode.August;

import javax.swing.tree.TreeNode;

/**
 * @Description: 222. 完全二叉树的节点个数
 * @Author: Mr.Fxy
 * @CreateTime: 2024-08-31 10:52
 */
public class LC222完全二叉树的节点个数 {
    public int countNodes(TreeNode root) {
        if (root==null) return 0;
        return countNodes(root.left)+countNodes(root.right)+1;
    }
}
